package com.xncoding.test01;

import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class test11 {


    public static void main(String[] args) {
        Random rand = new Random();
        List<String> givenList = Arrays.asList("one", "two", "three", "four");


            int randomIndex = rand.nextInt(givenList.size());
            String randomElement = givenList.get(randomIndex);
            System.out.println(randomElement);
    }
}

